﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Workflow.aspx.cs" Inherits="BlackHole.Workflow" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
    <asp:Panel ID="SearchOptions" runat="server">
    
        <div>按序列号：
    <asp:TextBox ID="txtSearchSerial" runat="server" AutoPostBack="True" 
                ontextchanged="txtSearchSerial_TextChanged"></asp:TextBox></div>
    <div>按网点：
    <asp:DropDownList ID="comboDistricts" runat="server" AutoPostBack="True" 
            onselectedindexchanged="comboDistricts_SelectedIndexChanged" Width="100px">
        </asp:DropDownList>
        <asp:DropDownList ID="comboOwners" runat="server" AutoPostBack="True" 
            onselectedindexchanged="comboOwners_SelectedIndexChanged">
        </asp:DropDownList>
        <asp:DropDownList ID="comboDevices" runat="server" AutoPostBack="True" 
            onselectedindexchanged="comboDevices_SelectedIndexChanged" Width="100px">
        </asp:DropDownList>
    </div>
    <div>产品状态：
        <asp:RadioButtonList ID="radioStatus" runat="server" AutoPostBack="True" 
            onselectedindexchanged="radioStatus_SelectedIndexChanged" 
            RepeatDirection="Horizontal">
        </asp:RadioButtonList>
    </div>
    

    </asp:Panel>
    <hr />
    <asp:Panel ID="panelProductInformation" runat="server">
    <div>
    序列号：<asp:TextBox ID="txtSelectedSerialNO" runat="server" Enabled="False"></asp:TextBox>
    设备类型：<asp:TextBox ID="txtSelectedDevice" runat="server" Enabled="False"></asp:TextBox>
    </div>
    <div>
        <asp:Label ID="lblSelectedOwner" runat="server" Text="Label"></asp:Label>
        PSAM卡号：<asp:TextBox ID="txtSelectedPsamNO" runat="server" Enabled="False"></asp:TextBox>
    </div>

    </asp:Panel>
    <asp:Panel ID="panelProductAddNew" runat="server" Visible="False">
    <div>未找到指定的产品，是否要新增入库？</div>
    <div>序列号:<asp:TextBox ID="txtAddSerialNO" runat="server" Enabled="False"></asp:TextBox>
    设备类型：<asp:DropDownList ID="comboAddDevice" runat="server" AutoPostBack="True" 
            onselectedindexchanged="comboAddDevice_SelectedIndexChanged">
        </asp:DropDownList>
    </div>

    <div>PSAM卡号：<asp:TextBox ID="txtAddPsamNO" runat="server"></asp:TextBox>
    固件版本：<asp:TextBox ID="txtAddRomVersion" runat="server"></asp:TextBox></div>
        <div>网点：<asp:DropDownList ID="comboAddDistricts" runat="server" AutoPostBack="True" 
                onselectedindexchanged="comboAddDistricts_SelectedIndexChanged">
        </asp:DropDownList>
        <asp:DropDownList ID="comboAddOwners" runat="server" AutoPostBack="True">
        </asp:DropDownList>
    </div>
    </asp:Panel>
        
        <asp:Panel ID="panelProductUnavailable" runat="server" Visible="False">
        <div>

            报修故障：<asp:DropDownList ID="comboRequestFault" runat="server" 
                AutoPostBack="True" 
                onselectedindexchanged="comboRequestFault_SelectedIndexChanged">
        </asp:DropDownList>
        
        </asp:Panel>
    <asp:Panel ID="panelProductRepair" runat="server" Visible="False">

    <div>实际故障：<asp:DropDownList ID="comboRealFault" runat="server" AutoPostBack="True" 
            onselectedindexchanged="comboRealFault_SelectedIndexChanged">
        </asp:DropDownList></div><div>
        固件版本：<asp:TextBox ID="txtRomVersion" runat="server"></asp:TextBox>

    </div>
    <div>        维修内容：<asp:TextBox ID="txtRepairMethod" runat="server"></asp:TextBox>
        
    </div>更换备件：<asp:TextBox ID="txtRepairGear" runat="server"></asp:TextBox>
    <div>
        </div>
    </asp:Panel>
    
    <asp:Panel ID="panelToolbar" runat="server">
        <asp:Button ID="btnOut" runat="server" Text="出库" onclick="btnOut_Click" 
                Visible="False" />
            <asp:Button ID="btnRepair" runat="server" Text="维修完成" Visible="False" 
            onclick="btnRepair_Click" />
            <asp:Button ID="btnRequestRepair" runat="server" Text="维修登记" 
            Visible="False" onclick="btnRequestRepair_Click" />
            <asp:Button ID="btnIn" runat="server" Text="直接入库" Visible="False" 
                Enabled="False" onclick="btnIn_Click" />
            <asp:Button ID="btnAddNew" runat="server" Text="新增入库" Visible="False" 
            onclick="btnAddNew_Click" />
            <asp:Button ID="btnAddAndRepair" runat="server" Text="新增并报修" 
            Visible="False" onclick="btnAddAndRepair_Click" style="height: 26px" />
        <asp:Button ID="btnAddAndRepair2" runat="server" Text="新增并维修" Visible="False" 
            onclick="btnAddAndRepair2_Click" />
            <asp:CheckBox ID="chkCheckIn" runat="server" AutoPostBack="True" 
                oncheckedchanged="chkCheckIn_CheckedChanged" Visible="False" />
                <div>
                    <asp:Label ID="lblError" runat="server" Text=string.Empty></asp:Label></div>
        </asp:Panel>
    <hr />
    <asp:Panel ID="ProductGridview" runat="server">
    <div>
        <asp:GridView ID="dataProducts" runat="server" AutoGenerateColumns="False" 
            AutoGenerateSelectButton="True" CellPadding="4" ForeColor="#333333" 
            GridLines="Vertical" ShowHeaderWhenEmpty="True" 
            DataKeyNames="Id,ProductDeviceName,ProductDeviceId,ProductDistrictName,ProductOwnerName,SerialNO,PsamNO,RomVersion,StatusId" 
            onselectedindexchanged="dataProducts_SelectedIndexChanged" 
            onpageindexchanged="dataProducts_PageIndexChanged" 
            onpageindexchanging="dataProducts_PageIndexChanging" AllowPaging="True" 
            ondatabinding="dataProducts_DataBinding">
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <Columns>
                <asp:BoundField DataField="Id" HeaderText="Id" SortExpression="Id" 
                    Visible="False" />
                <asp:BoundField DataField="ProductDeviceName" HeaderText="设备类型" 
                    SortExpression="ProductDeviceName" />
                <asp:BoundField DataField="ProductDistrictName" HeaderText="区县" 
                    SortExpression="ProductDistrictName" />
                <asp:BoundField DataField="ProductOwnerName" HeaderText="网点" 
                    SortExpression="ProductOwnerName" />
                <asp:BoundField DataField="StatusId" HeaderText="StatusId" 
                    SortExpression="StatusId" Visible="False" />
                <asp:BoundField DataField="StatusName" HeaderText="状态" 
                    SortExpression="StatusName" />
                <asp:BoundField DataField="SerialNO" HeaderText="序列号" 
                    SortExpression="SerialNO" />
                <asp:BoundField DataField="PsamNO" HeaderText="PSAM卡号" 
                    SortExpression="PsamNO" />
                <asp:BoundField DataField="RomVersion" HeaderText="固件版本" 
                    SortExpression="RomVersion" />
                <asp:BoundField DataField="ProductDeviceId" HeaderText="ProductDeviceId" 
                    Visible="False" />
                <asp:BoundField DataField="RepairCycle" HeaderText="维修次数" />
            </Columns>
            <EditRowStyle BackColor="#999999" />
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerSettings Mode="NumericFirstLast" PageButtonCount="5" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Right" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#E9E7E2" />
            <SortedAscendingHeaderStyle BackColor="#506C8C" />
            <SortedDescendingCellStyle BackColor="#FFFDF8" />
            <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
        </asp:GridView>
             <asp:ObjectDataSource ID="sourceGetProductByOwner" runat="server" 
                    SelectMethod="GetPagedProductsDetailByOwnerId" 
            TypeName="BlackHole.DAO.Utility" EnablePaging="True" 
            SelectCountMethod="GetProductsCountByOwnerId">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="comboDistricts" DefaultValue="0" 
                            Name="districtId" PropertyName="SelectedValue" Type="Int32" />
                        <asp:ControlParameter ControlID="comboOwners" Name="ownerId" 
                            PropertyName="SelectedValue" Type="Int32" />
                        <asp:ControlParameter ControlID="comboDevices" DefaultValue="0" Name="deviceId" 
                            PropertyName="SelectedValue" Type="Int32" />
                        <asp:ControlParameter ControlID="radioStatus" DefaultValue="0" Name="statusId" 
                            PropertyName="SelectedValue" Type="Int32" />
                    </SelectParameters>
                </asp:ObjectDataSource>

                <asp:ObjectDataSource ID="sourceGetProductBySerial" runat="server" 
                    SelectMethod="GetProductsDetailBySerialNO" 
                    TypeName="BlackHole.DAO.Utility">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="txtSearchSerial" DefaultValue="2a" Name="serialNO" 
                            PropertyName="Text" Type="String" />
                        <asp:ControlParameter ControlID="radioStatus" DefaultValue="0" Name="statusId" 
                            PropertyName="SelectedValue" Type="Int32" />
                    </SelectParameters>
                </asp:ObjectDataSource>
    </div>
    </asp:Panel>

    </ContentTemplate>
    </asp:UpdatePanel>

    </form>
</body>
</html>
